package com.xysd.express.adapter;

import android.content.Context;
import android.support.annotation.LayoutRes;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xysd.express.R;
import com.xysd.express.bean.AccountDetailsObj;

/**
 * Created by donghui on 2017/11/20.
 */

public class AccountDetailsAdpter extends BaseQuickAdapter<AccountDetailsObj.AccountDetails,BaseViewHolder> {
    Context context;

    public AccountDetailsAdpter(@LayoutRes int layoutResId, Context context) {
        super(layoutResId);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, AccountDetailsObj.AccountDetails item) {
        TextView trade_tv=helper.getView(R.id.trade_money_tv);
        if (item.Amount>0){
            trade_tv.setText("+"+item.Amount);
        }else {
            trade_tv.setText(""+item.Amount);
        }

        helper.setText(R.id.trade_title_tv,item.Remark);
        helper.setText(R.id.balance_tv,"余额:"+item.AfterAmount+"");
        helper.setText(R.id.date_tv,item.CreateTime);
    }
}
